/**
 * Created by Summer on 2016/1/25
 */

//languages切换
var $languages=$('.language_change');
$languages.hover(function(){
	$languages.addClass('mq-language-open').find('dl').stop().animate({'height': '113px'},200);
},function () {
	$languages.removeClass('mq-language-open').find('dl').stop().animate({'height': '0'},200);
});


/**
 @说明：右侧导航
 @作者：Daphne
 @时间：2016-5-10
 */
    //滚动条事件
var $navRt = $('#mq_index_navRt');
var $backT = $('#mq_index_navRt .backTop');
$(window).scroll(function () {
    var sT = $(window).scrollTop() ,
        navR_ht = $(window).height()/2;
    //右边导航滚动事件
    sT >= 190 ? $navRt.css({'position':'fixed','top':'inherit'}):$navRt.css({'position':'absolute','top':'100%'});
    sT >= navR_ht ? $backT.parent().fadeIn(300):$backT.parent().fadeOut(300);
});

//初始化右侧导航显示/隐藏
into_navRt();
function into_navRt(){
    var navR_ht = $(window).height();
    var $wH = $(window).scrollTop();
    $wH >= 190 ? $navRt.css({'position':'fixed','top':'inherit'}):$navRt.css({'position':'absolute','top':'100%'});
    $wH >= navR_ht ? $backT.parent().show():$backT.parent().hide();
}
//回到顶部
$('.backTop').click(function () {
    $('html,body').stop(false, false).animate({ scrollTop: 0 }, 500);
    i = 0;
});
//點擊事件
function newTop(){
    aCookie('NewsCookie',0,'h12')
}
/**
 @说明：导航条
 @作者：Daphne
 @时间：2016-5-10
 */
var $navList=$('#mq_nav_list .mq_nav_industry');
$navList.hover(function(){
    var len = $(this).find('dd').length;
    $(this).find('dl').stop().animate({'height': (96 * len) + 'px'},200);
},function () {
    $(this).find('dl').stop().animate({'height':'0'},100);
});


/** 搜索按钮*/
$('.searchAct').on('keyup','input',function(){
    var content = $(this).val();
    if(content.length < 1){
        $(this).siblings('i').removeClass('zq-act');
        return;
    }
    $(this).siblings('i').addClass('zq-act');

});

/** 最小高度 */
var windowH = $(window).innerHeight(),
    $gqBd = $('.gq-bd'),
    h = windowH - 120 ;
$gqBd.css('min-height',h);
/**/
$('.mq_nav_container li:nth-child(3)').click(function(){
    aCookie('flg',false,'h12');
});

/** 输入框默认值 */
// inputPlaceholder();
// // 如果不支持placeholder，用jQuery来完成
// function inputPlaceholder(){
//     if (!isSupportPlaceholder()) {
//         // 遍历所有input对象跟textarea对象, 除了密码框
//         $('input:not(input[type="password"]),textarea').each(function () {
//             var self = $(this);
//             var val = self.attr("placeholder");
//             placeholderVal(self, val);
//         });
//     }
// }
//
// // 判断浏览器是否支持placeholder属性
// function isSupportPlaceholder() {
//     var input = document.createElement('input');
//     return 'placeholder' in input;
// }
//
// // jQuery替换placeholder的处理
// function placeholderVal(obj,objVal) {
//     var defaultValue = obj.defaultValue;
//     if(!defaultValue){
//         if(!objVal){
//             return;
//         }else{
//             obj.val(objVal).css('color','#a9a9a9');
//         }
//     }
//     obj.focus(function(){
//         if(obj.val() == objVal){
//             obj.val('');
//         }
//     }).blur(function(){
//         if(obj.val() == ""){
//             obj.val(objVal).css('color','#a9a9a9');
//         }
//     });
//     //输入的字符不为灰色
//     obj.keydown(function(){
//         obj.css('color','#666');
//     });
// }




/*
 @说明：选项卡
 @作者：summer
 @时间：2015-1-26
 */
(function ($) {
    $.fn.Tab = function (o) {
        o = $.extend({
            child: 'ms-tab-bar', //title
            item: 'ms-tab-item', //当前层
            act: 'click', //响应事件
            cur: 'current' //选中类名
        }, o || {});
        return this.each(function () {
            var $this = $(this), tab = $('.' + o.child, $this), item = $('.' + o.item, $this);
            tab.on(o.act, function () {
                $(this).addClass(o.cur).siblings().removeClass(o.cur);
                item.eq($(this).index()).removeClass('f-dn').siblings().addClass('f-dn');
                return false;
            });
        });
    };
})(jQuery);

//时间戳转换成时间
function UnixToDate(unixTime, isFull, timeZone) {
	ymdhis = '0000-00-00';
	if( unixTime > 0 ){
		if (typeof (timeZone) == 'number'){
			unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60;
		}
		var time = new Date(unixTime * 1000);
		var ymdhis = "";
		ymdhis += time.getUTCFullYear() + "-";
		ymdhis += (time.getUTCMonth()+1) + "-";
		ymdhis += time.getDate();
		if (isFull === true)
		{
			ymdhis += " " + time.getUTCHours() + ":";
			ymdhis += time.getUTCMinutes() + ":";
			ymdhis += time.getDate();
		}
	}
	return ymdhis;
}
//随机数
function getRand(){
	num = Math.round(Math.random()*1000000)+Math.round(Math.random()*10);
	return num;
}
//替换
function replaceAll(str,a1,a2){
	if(str!=null){
		str = str.replace(new RegExp(a1,"gm"),a2);
	}
	return str;
}
//是否数组
function isArray(obj){  
  return Object.prototype.toString.call(obj) === '[object Array]';   
}
//验证是否手机
function isMobile(mobile){
	var mobilereg = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d\d\d\d\d\d\d\d$/i;
	if(!mobilereg.test(mobile) || mobile.length!=11){
		return false;	
	}else{
	    return true;	
	}
}
//验证是否座机
function isLandline(mobile){
	var landlinereg = /^((\d{3,4})-)(\d{3,8})(-(\d{3,8}))?$/;
	if(!landlinereg.test(mobile)){
		return false;
	}else{
	    return true;
	}
}


//验证邮箱
function isEmail(email){
	if( email && /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(email) == false ){
		return false;
	}
	return true;	
}

//中文名验证
function isName(name){
	if( name && /^([\u4E00-\u9FA5])+$/i.test(name) == false ){
		return false;
	}
	return true;
}
//获取账号类型
function getUserType(string){
	if(isMobile(string)){
		return 2;	
	}
	if(isEmail(string)){
		return 1;	
	}
	return 0;
}
//视频配置
function setVideo(configArr){
	var html		= '';
	var url			= 'http://f1.chofn.net/M00/83/2E/wKgA7FUvTrqADkUXAY_NpNWDnYM570.flv';
	var swf_width	= configArr['width'] ? configArr['width'] : 568;
	var swf_height	= configArr['height'] ? configArr['height'] : 320;
	var files		= configArr['files'] ? configArr['files'] : url;
	var texts		= configArr['texts'] ? configArr['texts'] : '超凡知识产权宣传片';
	var config 		= '1|0|100|0|2|0x000033|60|0x66ff00|0xffffff|0xffffff|CHOFN|http://www.chofn.com/images/CuPlayer/images/Logo.png|';
	html +='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">';
	html +='<param name="movie" value="/Static/script/flashPlayer/vcastr2.swf"><param name="quality" value="high">';
	html +='<param name="menu" value="false"><param name=wmode value="opaque">';
	html +='<param name="FlashVars" value="vcastr_file='+files+'&vcastr_title='+texts+'&vcastr_config='+config+'">';
	html +='<embed src="/Static/script/flashPlayer/vcastr2.swf" wmode="opaque" FlashVars="vcastr_file='+files+'&vcastr_title='+texts+'&vcastr_config='+config+'" menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	html +='</object>';
	return html;
}

function uploadImg() {
	$('#sendSubmit').attr('disabled',true);
	var size = $("#fileLoad")[0].files[0].size;
	var filepath = $('#fileLoad').val();
	var extStart = filepath.lastIndexOf(".");
	var ext = filepath.substring(extStart, filepath.length).toUpperCase();
	if (ext != ".BMP" && ext != ".PNG" && ext != ".JPG" && ext != ".JPEG") {
		alert("请上传 jpg , jpeg , png , bmp 扩展名的文件");
		$('#fileLoad').val('');
		$('#sendSubmit').attr('disabled',false);
		return false;
	}
	if(size > 2*1024*1024){
		alert('上传失败,图片大小不能超过2M');
		$('#sendSubmit').attr('disabled',false);
		return false;
	}
	$('.upload').show();
	$.ajaxFileUpload({
		url: '/uploadfile/uploadFile',
		type: 'post',
		secureuri: false,
		fileElementId: 'fileLoad',
		dataType: 'json',
		async: false,
		success: function (data, status) {
			if(typeof(data.error) != 'undefined'){
				if(data.error == 0){
					$('#sendSubmit').attr('disabled',false);
					$('.mq-uploadInput').removeAttr('style').find('input[type="text"]').val(data.url);
					$('#fileLoad').next().text('重新上传');
					$('.upload').hide();
				}else{
					$('.upload').hide();
					$('#sendSubmit').attr('disabled',false);
					alert(data.message);
				}
			}
		},
		error: function (data, status, e) {   //提交失败自动执行的处理函数
//                    alert(e);
		}
	});
	return false;
}



function filedelete(dom) {
	var _this = $(dom);
	var url   = _this.prev().val();
	$.ajax({
		url:'/investor/delimg/',
		type:'post',
		data:{url:url},
		dataType: "json",
		async: false,
		beforeSend: function(){
			// $('.upload').show();
		},
		success:function(data){
				if(data.code == 0){
					_this.prev().val('');
					$('.mq-uploadInput').hide();
					$('.upload').hide();
					$('#fileLoad').val('').next().text('上传附件');
				}else {
					alert(data.msg)
				}
		},
		error:function(err){
			console.log(err);
		}
	});
}

function details_right(el, jsonData, code) {

	//数据
	var timeLineData = jsonData.data;
	//数据长度
	var length = timeLineData.length;
	//最后数据
	var last_data = jsonData.data[length-1];
	//开盘价
	var todayOpen = Number(jsonData.open);
	//昨收(如果昨收为0，今开不为0，昨收用今开来计算)
	var yesterdayClose = jsonData.yes == 0 && jsonData.open != 0 ? Number(jsonData.open) : Number(jsonData.yes);
	var todayDate = timeLineData[0][0];

	var caldatas = [];
	var positions = [];

	var day = Highcharts.dateFormat('%Y/%m/%d', todayDate),
		breaks = [{
			from: new Date(day + ' 11:30').getTime(),
			to: new Date(day + ' 13:00').getTime(),
			breakSize: 0 * 60 * 1000
		}],
		min = new Date(day + ' 9:30').getTime(),
		max = new Date(day + ' 15:00').getTime(),
		// x 轴标签便宜高度
		height = $('#' + el).height() * 0.23,
		width = $('#' + el).width();

	if(jsonData.yes == 0 && last_data[2] == 0){
		var ymin = -2.0;
		var ymax = 2.0;
		var startOnTick = false;
		var endOnTick = false;
	}else{
		var ymin = null;
		var ymax = null;
		var startOnTick = true;
		var endOnTick = true;
	}

	caldatas = cal_data(timeLineData,yesterdayClose);
	show_info(timeLineData,yesterdayClose,jsonData.open,'si_fs_infos',1);
	//提示框出现
	$('#si_fs_infos').show();

	// Create the chart
	$('#' + el).highcharts('StockChart', {
		chart: {
			spacing: 1,
			borderRadius: 0,
			animation: false,
			events: {
				load: function() {

					//获取当天日期
					var myDate = new Date();
					// var year = myDate.getFullYear();
					var month = myDate.getMonth()+1;
					var day = myDate.getDay();
					var hour = myDate.getHours();
					var minute = myDate.getMinutes();
					var times = hour + ':' + minute;

					yesterdayClose = Number(jsonData.yes);
					todayOpen = Number(jsonData.open);
					//地址
					var url = '/investor/getAjax/?hqzqdm=' + code;
					$.getJSON(url,function(jsonData) {
						var chart = $('#' + el).highcharts();

						timeLineData = jsonData.data;

						//价格
						var cur_price = jsonData.f3;

						//重新计算
						caldatas = cal_data(timeLineData,yesterdayClose);
						//更新图表
						chart.series[0].update({
							data: timeLineData
						},false);
						chart.series[1].update({
							data: timeLineData
						},false);
						chart.series[2].update({
							data: caldatas[4]
						},false);

						chart.redraw();
						var DateString = myDate.toLocaleDateString();
						var date  = jsonData.date;
						var year  = date.split(' ');
						var newtime = '';
						var time = DateString.replace(/\//g,'-');
						if(time_range("09:30", "11:30") || time_range("13:00", "15:00") && myDate.getDay() <= 5){
							if((time_range("09:30", "11:30") || time_range("13:00", "15:00")) && myDate.getDay() <= 5){
								newtime = jsonData.date;
							}else {
								newtime = year[0] +" 15:00:00";
							}
						}else {
							if(times < "13:00" && times > "11:30" && myDate.getDay() <= 5){
								newtime = year[0] +" 11:30";
							}else {
								newtime = year[0] +" 15:00:00";
							}
						}

						//更新基本信息
						var pnum_html = '';
						var curpri_html = '';
						if(cur_price > jsonData.yes){//涨
							pnum_html = "<div class='numbers'><span class='price'><span class='red_font'>¥"+ jsonData.f3_float + "</span></span>";
							pnum_html += "<span class='updown'><span class='red_font'>+" + jsonData.zz + "(" + jsonData.updown + "%)</span></span></div>";
							pnum_html += "<div class='date'>" + newtime +"</div>";
							curpri_html = "<span class='red_font'>" + jsonData.f3_float + "</span>";
						}else if(cur_price < jsonData.yes){//跌
							pnum_html = "<div class='numbers'><span class='price'><span class='green_font'>¥"+ jsonData.f3_float + "</span></span>";
							pnum_html += "<span class='updown'><span class='green_font'>" + jsonData.zz + "(" + jsonData.updown + "%)</span></span></div>";
							pnum_html += "<div class='date'>" + newtime +"</div>";
							curpri_html = "<span class='green_font'>" + jsonData.f3_float + "</span>";
						}else{//相等
							pnum_html = "<div class='numbers'><span class='price'><span class='green_font'>¥"+ jsonData.f3_float + "</span></span>";
							pnum_html += "<span class='updown'><span class='green_font'>" + jsonData.zz + "(" + jsonData.updown + "%)</span></span></div>";
							pnum_html += "<div class='date'>" + newtime +"</div>";
							curpri_html = "<span class='green_font'>" + jsonData.f3_float + "</span>";
						}
						$('.pnum').html(pnum_html);

						//涨跌，涨跌幅,最高最低
						$('.pdata table').find('tr').eq(1).find('td').eq(0).html('涨跌：' + jsonData.zz);
						$('.pdata table').find('tr').eq(1).find('td').eq(1).html('涨跌幅(%)：' + jsonData.updown);
						$('.pdata table').find('tr').eq(1).find('td').eq(2).html('最高：' + jsonData.f7);
						$('.pdata table').find('tr').eq(1).find('td').eq(3).html('最低：' + jsonData.f8);

						//成交量，成交额，成交笔数，振幅
						$('.pdata table').find('tr').eq(2).find('td').eq(0).html('成交量：' + jsonData.f4/10000 + '万');
						$('.pdata table').find('tr').eq(2).find('td').eq(1).html('成交额(万元)：' + jsonData.f5);
						$('.pdata table').find('tr').eq(2).find('td').eq(2).html('成交笔数：' + jsonData.f6);
						$('.pdata table').find('tr').eq(2).find('td').eq(3).html('振幅(%)：' + jsonData.zhenfu);

						//买卖价
						var t1_html = "<table><tbody><tr><td>卖5</td><td>"+ jsonData.f14 +"</td><td>"+ jsonData.f15 +"</td></tr>";
						t1_html += "<tr><td>卖4</td><td>"+ jsonData.f16 +"</td><td>"+ jsonData.f17 +"</td></tr>";
						t1_html += "<tr><td>卖3</td><td>"+ jsonData.f18 +"</td><td>"+ jsonData.f19 +"</td></tr>";
						t1_html += "<tr><td>卖2</td><td>"+ jsonData.f20 +"</td><td>"+ jsonData.f21 +"</td></tr>";
						t1_html += "<tr><td>卖1</td><td>"+ jsonData.f22 +"</td><td>"+ jsonData.f23 +"</td></tr></tbody></table>";

						var t2_html = "<table><tbody><tr><td>买1</td><td>"+ jsonData.f24 +"</td><td>"+ jsonData.f25 +"</td></tr>";
						t2_html += "<tr><td>买2</td><td>"+ jsonData.f26 +"</td><td>"+ jsonData.f27 +"</td></tr>";
						t2_html += "<tr><td>买3</td><td>"+ jsonData.f28 +"</td><td>"+ jsonData.f29 +"</td></tr>";
						t2_html += "<tr><td>买4</td><td>"+ jsonData.f30 +"</td><td>"+ jsonData.f31 +"</td></tr>";
						t2_html += "<tr><td>买5</td><td>"+ jsonData.f32 +"</td><td>"+ jsonData.f33 +"</td></tr></tbody></table>";

						$('.details_right .right_data').eq(0).html(t1_html);
						$('.details_right .right_data').eq(1).html(t2_html);
						$('.details_right .current_price').find('td').eq(2).html(curpri_html);
						var ktime = '';
						if((time_range("09:30", "11:30") || time_range("13:00", "15:00")) && myDate.getDay() <= 5){
							ktime = Highcharts.dateFormat('%H:%M', jsonData.f0);
						}else {
							if(!time_range("09:30", "11:30") && hour < 15){
								if(times < "13:00" && times > "11:30"  && myDate.getDay() <= 5){
									ktime = "11:30";
								}else {
									ktime = "15:00";
								}
							}else {
								ktime = "15:00";
							}
						}
						//fs_infos
						var fs_infos_open = '今开:' + todayOpen + space;
						var fs_infos_cur = '当前:' + jsonData.f3_float;
						fs_infos_cur += jsonData.zz > 0  ? "<span class='red_font'>(" + jsonData.updown + "%)</span>" :  "<span class='green_font'>(" + jsonData.updown + "%)</span>";
						var fs_infos_time = '时间:' + ktime;
						var fs_infos = fs_infos_open + fs_infos_cur + space + fs_infos_time;
						$('#si_fs_infos').html(fs_infos);

					});

				}
			}
		},
		colors: ['#2f7ed8', '#2E84CC', '#8bbc21', '#910000', '#1aadce',
			'#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'],
		rangeSelector: {
			enabled: false
		},
		scrollbar: {
			enabled: false,
		},
		navigator: {
			enabled: false
		},

		title: {
			text: ''
		},
		credits: {
			// enabled: false.
			text: 'Chinaipo111.com',
			href: 'http://www.chinaipo.com',
			position: {
				align: 'left',
				x: 350,
				y: -height - 26,
				style: {
					cursor: 'pointer',
					fontSize: '12px'
				}
			}
		},
		xAxis: [{
			min: min,
			max: max,
			gridLineWidth: 1,
			tickLength: 0,
			labels: {
				y: -height - 5,
				autoRotation: false,
				autoRotationLimit: 0,
				formatter: function() {
					if (this.value === new Date(day + ' 11:30').getTime()) {
						return '11:30/13:00';
					}
					return Highcharts.dateFormat('%H:%M', this.value);
				}
			},
			breaks: breaks,
			tickPositioner: function() {
				return [new Date(day + ' 09:30').getTime(), new Date(day + ' 10:30').getTime(), new Date(day + ' 11:30').getTime(), new Date(day + ' 14:00').getTime(), new Date(day + ' 15:00').getTime()]
			},
		}],
		yAxis: [{
			max:ymax,
			min:ymin,
			startOnTick:startOnTick,
			endOnTick:endOnTick,
			height: '70%',
			lineColor: '#C7CBD4',
			opposite: false,
			lineWidth: 1,
			labels: {
				x: 10,
				align: 'left',
				formatter: function() {
					if(yesterdayClose == 0){
						if(this.value == 0){
							return '0.00';
						}else{
							return false;
						}
					}else{
						if (this.value.toFixed(2) == yesterdayClose) {
							return this.value.toFixed(2);
						} else if (this.value > yesterdayClose) {
							return '<span style="color:#D71720">' + this.value.toFixed(2) + '</span>';
						} else {
							return '<span style="color:#00a650">' + this.value.toFixed(2) + '</span>';
						}
					}
				}
			},
			showFirstLabel: true,
			showLastLabel: true,
			tickPositioner: function() {
				positions = cal_positions(timeLineData,yesterdayClose,caldatas);
				if(jsonData.yes == 0){
					positions = [2.00,1.00,0.00,-1.00,-2.00];
				}
				return positions;
			},
			plotLines: [{
				value: yesterdayClose,
				width: 2,
				color: '#D71720',
				dashStyle: 'shortDot',
				label: {
					y: 14
				}
			}],
		},
			{
				max:ymax,
				min:ymin,
				startOnTick:startOnTick,
				endOnTick:endOnTick,
				height: '70%',
				opposite: true,
				showFirstLabel: true,
				showLastLabel: true,
				gridLineWidth: 1,
				labels: {
					x: -10,
					align: 'right',
					formatter: function() {
						if(yesterdayClose == 0){
							if(this.value == 0){
								return '0.00%'
							}else{
								return false;
							}
						}else{
							var percent = (this.value - yesterdayClose) / yesterdayClose * 100,
								flag = percent > 0 ? '+': '';
							if (percent.toFixed(2) == 0) {
								return percent.toFixed(2) + '%';
							} else if (this.value > yesterdayClose) {
								return '<span style="color:#D71720">' + flag + percent.toFixed(2) + '%</span>';
							} else {
								return '<span style="color:#00a650">' + flag + percent.toFixed(2) + '%</span>';
							}
						}
					}
				},
				showFirstLabel: false,
				tickPositioner: function() {
					return positions;
				}

			},
			{
				top: '77%',
				height: '23%',
				showFirstLabel: false,

				labels: {
					x: -10,
					align: 'right',
					formatter: function() {
						return (this.value / 10000).toFixed(2) + '万';
					}
				}
			}],
		plotOptions: {
			series: {
				dataGrouping: {
					enabled: false
				},
				pointPlacement: 'on'
			}
		},

		tooltip: {
			shared: true,
			useHTML: true,
			shadow: false,
			borderColor: "rgba(255, 255, 255, 0)",
			backgroundColor: "rgba(255, 255, 255, 0)",
			formatter: function() {
				yesterdayClose = Number(jsonData.yes);
				todayOpen = Number(jsonData.open);
				var points = this.points,
					percent = 0,
					str = '今开:' + todayOpen.toFixed(2) + space,
					time = '时间:' + Highcharts.dateFormat('%H:%M', this.points[0].x);

				// console.log(points);
				// str
				Highcharts.each(points,
					function(p, i) {
						if (i === 0) {
							str += '当前:' + p.y.toFixed(2);
						} else if (i === 1) {
							if(yesterdayClose == 0){
								str += "(0.00%)" + space;
							}else{
								percent = (p.y - yesterdayClose) / yesterdayClose * 100;
								str += '<span style="color: ' + (percent > 0 ? '#D71720': '#00a650') + '">(' + percent.toFixed(2) + '%)</span>' + space;
							}
						}
						// else if (i === 2) {
						//     str += '成交量(万):' + (p.y / 10000).toFixed(2) + space
						// }
					});

				str += time;

				$('#si_fs_infos').html(str);

			}
		},

		series: [{
			name: '开盘价',
			data: timeLineData,
			tooltip: {
				valueDecimals: 2
			},
			// color: Highcharts.getOptions().colors[1],
			lineWidth: 0,
			states: {
				hover: {
					lineWidthPlus: 0,
					lineWidth: 1
				}
			}
		},
			{
				name: '涨幅',
				data: timeLineData,
				yAxis: 1,
				zIndex: 10,
				lineWidth: 1,
				states: {
					hover: {
						lineWidthPlus: 0,
						lineWidth: 1
					}
				}

			},
			{
				name: '成交量',
				data: caldatas[4],
				yAxis: 2,
				type: 'column'
			}]
	});

}


//时间范围
function time_range(beginTime, endTime) {
	var strb = beginTime.split(":");
	if (strb.length != 2) {
		return false;
	}

	var stre = endTime.split(":");
	if (stre.length != 2) {
		return false;
	}

	var b = new Date();
	var e = new Date();
	var n = new Date();

	b.setHours(strb[0]);
	b.setMinutes(strb[1]);
	e.setHours(stre[0]);
	e.setMinutes(stre[1]);

	if (n.getTime() - b.getTime() > 0 && n.getTime() - e.getTime() < 0) {
		return true;
	} else {
		return false;
	}
}

/*var article = (function(jquery){

    //article 文章点赞
    articleLike = function(){

    };

    return articleLike;

}(jQuery));*/




